from pip._vendor.requests.auth import AuthBase
from rest_framework.permissions import IsAuthenticated
from rest_framework.views import APIView
from rest_framework_simplejwt.authentication import JWTAuthentication

# 继承此类的视图需要进行认证
class MyAuth(APIView):
    # 登录认证
    authentication_classes = (JWTAuthentication,)
    # 配置了权限类，没登录的就没有权限访问了
    permission_classes = (IsAuthenticated,)


